home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 September
/
CHIP Eylül 1998.iso
/
Slackwar
/
docs
/
slack-docs
/
base
/
demon_ppp.dip
< prev
next >
Wrap
Text File
|
1996-05-09
|
6KB
|
191 lines
# demon_ppp.dip: connection script for PPP.
# Copyright 1994-6 John A. Phillips - john@linux.demon.co.uk
# **********************************************************************
# * Configuration and modem set-up section *****************************
# **********************************************************************
# Set up the counters for permitted log-in attempts.
get $free_times 10
get $paid_times 3
# Set the desired serial port name (in /dev) and port speed.
port modem
speed 115200
# Define the modem initialisation string. This is the string sent to
# the modem by the dial command each time just prior to (re-)dialling.
#
# For the USR Courier V.Everything (see Demon's Modem.txt)
# ========================================================
# Mode Set by Comment
# B0 &F1 ITU-T answer mode (not US Bell answer mode)
# C1 Default Transmitter enabled
# E1 * D/SW 4 Command mode echo on
# F1 Default Full duplex (online local echo off)
# Q0 * D/SW 3 Display result codes
# V1 * D/SW 2 Verbal (not numeric) result codes
# &A3 &F1 Display the most detailed connect result codes
# &B1 Default Serial port data rate stays fixed
# &C1 * D/SW 6 Modem sends Carrier Detect (CD) on connection
# &D2 * D/SW 1 DTR enables the modem (when set) or drops the line
# &G2 * - UK guard tone (1800 Hz)
# &H1 &F1 Enable hardware (CTS) transmit flow control
# &I0 &F1 Disable software (XON/XOFF) receive flow control
# &K3 * - Use V.42bis compression only (no MNP5)
# &N0 Default Modem negotiates variable link rate
# &R2 &F1 Enable hardware (RTS) receive flow control
# &S1 * - Modem sends DSR to CPU on answer
#
# Other additions
# ===============
# X6 - Report VOICE on the line
# &M5 - Drop non-ARQ connections
# S39=15 - Reduce the transmit level from -10 dBm to -15 dBm
# S54.5=1 - Disable the top V.34 baud rate (Ascend problem?)
init ATE1Q0V1&C1&D2&G2&K3&S1X6&M5S39=15S54.5=1
# Set up the non-default chat keys for the dial command (see "man dip"
# for the defaults, and note that dial returns errlvl 3 on timeout).
chatkey NO\sDIAL\sTONE 5
chatkey BUSY 6
chatkey RINGING\r\n\r\nRINGING\r\n\r\nRINGING 7
chatkey VOICE 8
# Turn on echoing of the control commands, responses etc.
echo on
# Reset the terminal line and modem. This may be necessary for some
# people but unnecessary for others. Uncomment the next line only if
# you need to reset the modem here.
# reset
# Send a set-up string to the modem. This string is sent once only.
# The init string (above) is sent to the modem before each (re-)dial.
send AT&F1\r
wait OK 3
print
if $errlvl == 0 goto dial
print Timeout or other error setting up the modem - OK not received
exit 1
# **********************************************************************
# * Dialling section ***************************************************
# **********************************************************************
dial:
print
# Dial Chelmsford National Mercury ROMP with timeout.
print Dialling the Chelmsford NMR ...
dial T01245-708666 45
# Deal with a specified result from the dial command.
if $errlvl == 0 goto othererr
if $errlvl == 1 goto connect
if $errlvl == 2 goto othererr
if $errlvl == 3 goto timeout
if $errlvl == 4 goto nocarrier
if $errlvl == 5 goto nodialtone
if $errlvl == 6 goto busy
if $errlvl == 7 goto ringing
if $errlvl == 8 goto voice
# Deal with an unspecified result from the dial command.
print
print Unknown error from the dial command
exit 1
# **********************************************************************
# * Dial error handling section ****************************************
# **********************************************************************
# Use reset only if the response from the dial command fails to properly
# take the modem off-line and into command mode. The VOICE, RINGING and
# TIMEOUT responses need it (USR Courier).
voice:
print VOICE
reset
goto paid_redial
ringing:
print RINGING OUT
reset
goto free_redial
busy:
print BUSY
goto free_redial
nodialtone:
print NO DIAL TONE
goto free_redial
nocarrier:
print NO CARRIER waiting for CONNECT
goto paid_redial
timeout:
print TIMEOUT waiting for CONNECT
reset
goto paid_redial
othererr:
print
print Unexpected OK or ERROR received from the modem
exit 1
# **********************************************************************
# * Re-dialling section ************************************************
# **********************************************************************
free_redial:
dec $free_times
if $free_times > 0 goto dial
print
print Exceeded the free tries limit
exit 1
paid_redial:
dec $paid_times
if $paid_times > 0 goto dial
print
print Exceeded the paid tries limit
exit 1
# **********************************************************************
# * Login section ******************************************************
# **********************************************************************
connect:
wait ogin: 20
if $errlvl != 0 goto login_error
sleep 1
send <YOUR_HOST_NAME>\r
wait word: 60
if $errlvl != 0 goto password_error
send <YOUR_PASSWORD>\r
wait ocol: 60
if $errlvl != 0 goto protocol_error
send ppp,nolqm,idle=240\r
wait HELLO 60
if $errlvl != 0 goto hello_error
# Announce the connection.
print
print Dial-up and log-on completed
# Recommended for the Ascend servers.
# sleep 1
# send \r
# Initiate PPP and exit.
mode PPP
exit 0
# **********************************************************************
# * Login error handling section ***************************************
# **********************************************************************
login_error:
print Timeout or other error waiting for the login prompt
goto login_redial
password_error:
print Timeout or other error waiting for the password prompt
goto login_redial
protocol_error:
print Timeout or other error waiting for the protocol prompt
goto login_redial
hello_error:
print Timeout or other error waiting for the HELLO prompt
login_redial:
reset
goto paid_redial